﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    /// <summary>
    /// Object一切皆定义
    /// </summary>
    /// 
    /* 1,重写 override 与重载
     *       重写，函数名，参数个数及类型，返回值要保持一致
     *        virtual   override
     *        ""    new
     * 
     * 2,属性的默认值 字符串格式化， $()
     * 3,
     */
    class People
    {
        //public People(int id, string name)
        //{
        //    Id = id;
        //    Name = name;

        //}

        public int Id { get; set; } = 0;

        public string Name { get; set; } = "";

        public void Eat()
        {
            Console.WriteLine("吃饭");
        
        }
        public void Eat(string food)
        {
            Console.WriteLine("吃" + food);

        }
        
        public override string ToString()
        {
            //return string.Format("我叫[0],我的Id是[1]",Name,Id);
            return "我叫" + Name + "我的Id是" + Id;
        }
        
    }
}
